package com.xca.znb.model.impl;

import android.content.Context;

import com.xca.znb.database.UserDAO;
import com.xca.znb.entity.User;
import com.xca.znb.model.imodel.IPersonalCenter;

public class PersonalCenterImpl implements IPersonalCenter {
    private UserDAO userDAO ;

    public PersonalCenterImpl(Context context){userDAO = new UserDAO(context);}

    @Override
    public User getUser(String phone) {
        return userDAO.getUser(phone);
    }

    @Override
    public void updateName(String phone, String newName) {
        userDAO.updateNameByPhone(phone, newName);
    }

    @Override
    public void updateAge(String phone, String age) {
        userDAO.updateAgeByPhone(phone, age);
    }

    @Override
    public void updateLocal(String phone, String local) {
        userDAO.updateLocalByPhone(phone, local);
    }

    @Override
    public void updateConcern(String phone, String avatarPath) {
        userDAO.updateConcernByPhone(phone, avatarPath);
    }
}
